<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">
<body>
<!-- 分页 -->
<div th:fragment="pagination">
	<nav style="text-align: right;" th:if="${pagination != null and pagination.totalPages > 0 and #arrays.length(pagination.pages) > 0}">
		<span class="header smaller lighter blue" th:text="@{'总页 : ' + ${pagination.totalPages} + ' 总数 :' + ${pagination.totalElements}}"></span>
		<ul class="pagination " style="margin: 0px">
			<!-- 上一页 -->
			<li th:if="${pagination.hasPreviousPage}"><a th:href="@{${action}(current_page=${pagination.currentPage-1})}" aria-label="Previous"> <span
					aria-hidden="true">&laquo;</span>
			</a></li>
			<!-- 遍历总页数 -->
			<li th:each="num:${pagination.pages}" th:inline="text" th:class="${num == pagination.currentPage}?'active'"><a th:href="@{${action}(current_page=${num})}">[[${num}]]</a></li>
			<!-- 下一页码 -->
			<li th:if="${pagination.hasNextPage}"><a th:href="@{${action}(current_page=${pagination.currentPage+1})}" aria-label="Next"> <span aria-hidden="true">&raquo;</span>
			</a></li>
		</ul>
	</nav>
</div>
</body>
</html>